{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
<!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
             <form action="" method="post">	
                <div class="box-header with-border">
                    <span class="fa fa-edit (alias)" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">成绩录入</p>
                </div>
                <div class="box-body">
                      <div class="form-group">
						  <label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							   年级名称：
						  </label>
						  <div class="input-group col-md-6 col-sm-12 col-xs-12">
							   <select class="form-control" name="grade_id">
							   {%foreach from=$grade_list key=key item=value%}
                                    <option value="{%$value.grade_id%}"> {%$value.grade_name%}</option>
                               {%/foreach%}
                               </select> 
						  </div> 
				      </div>
                       <div class="form-group">
						  <label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							   班级名称：
						  </label>
						  <div class="input-group col-md-6 col-sm-12 col-xs-12">
							   <select class="form-control" name="class_id">
							   {%foreach from=$class_list key=key item=value%}
                                    <option value="{%$value.class_id%}"> {%$value.class_name%}</option>
                               {%/foreach%}
                               </select> 
						  </div> 
				      </div>
                       <div class="form-group">
						  <label for="inputPassword3" class="col-md-3 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
							   科目名称：
						  </label>
						  <div class="input-group col-md-6 col-sm-12 col-xs-12">
							   <select class="form-control" name="subject_id">
								{%foreach from=$subject_list key=key item=value%}
                                    <option value="{%$value.subject_id%}"> {%$value.subject_name%}</option>
                                {%/foreach%}
                               </select> 
						  </div> 
				      </div>    
				</div><!--box-body -->
                <div class="box-footer text-center">
                    <button type="submit" class="btn btn-primary "> 成绩录入</button>
                </div>
              </form>
           </div><!--box box-default box-solid-->
         </section>   
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
  <!--二级联动-->
<script type="text/javascript">
        $(document).ready(function () {
       $("#grade1").change(function () {
                if ($(this).val() == "-1") { $("#industr").remove(); return; }
                else {
			$.ajax({
			url:"http://schoolplat.wangyunw.com/public/index.php?a=student.listjson",
			type:"get",
			data: "class_id=" + $("#grade1").find("option:selected").val(),
			dataType:"json",
			success:function(msg){
			   
                            //实例2个字符串变量来拼接下拉列表
                            var industr = "";
                            //使用jquery解析json中的数据
                            $.each(msg, function (n, value) {
                                industr += ("<option value=\"" + value.student_id + "\">" + value.student_name);
                                industr += ("</option>");
                            });
                            $("#select1").html(industr);			   
			   
			}
			});					
                }
            });
			
        });
    </script>

